package com.ruoyi.bantong.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bantong.mapper.BtOrganizationLevelMapper;
import com.ruoyi.bantong.domain.BtOrganizationLevel;
import com.ruoyi.bantong.service.IBtOrganizationLevelService;

/**
 * 机构等级Service业务层处理
 * 
 * @author laohei
 * @date 2021-01-24
 */
@Service
public class BtOrganizationLevelServiceImpl implements IBtOrganizationLevelService 
{
    @Autowired
    private BtOrganizationLevelMapper btOrganizationLevelMapper;

    /**
     * 查询机构等级
     * 
     * @param levelId 机构等级ID
     * @return 机构等级
     */
    @Override
    public BtOrganizationLevel selectBtOrganizationLevelById(Integer levelId)
    {
        return btOrganizationLevelMapper.selectBtOrganizationLevelById(levelId);
    }

    /**
     * 查询机构等级列表
     * 
     * @param btOrganizationLevel 机构等级
     * @return 机构等级
     */
    @Override
    public List<BtOrganizationLevel> selectBtOrganizationLevelList(BtOrganizationLevel btOrganizationLevel)
    {
        return btOrganizationLevelMapper.selectBtOrganizationLevelList(btOrganizationLevel);
    }

    /**
     * 新增机构等级
     * 
     * @param btOrganizationLevel 机构等级
     * @return 结果
     */
    @Override
    public int insertBtOrganizationLevel(BtOrganizationLevel btOrganizationLevel)
    {
        btOrganizationLevel.setCreateTime(DateUtils.getNowDate());
        return btOrganizationLevelMapper.insertBtOrganizationLevel(btOrganizationLevel);
    }

    /**
     * 修改机构等级
     * 
     * @param btOrganizationLevel 机构等级
     * @return 结果
     */
    @Override
    public int updateBtOrganizationLevel(BtOrganizationLevel btOrganizationLevel)
    {
        btOrganizationLevel.setUpdateTime(DateUtils.getNowDate());
        return btOrganizationLevelMapper.updateBtOrganizationLevel(btOrganizationLevel);
    }

    /**
     * 批量删除机构等级
     * 
     * @param levelIds 需要删除的机构等级ID
     * @return 结果
     */
    @Override
    public int deleteBtOrganizationLevelByIds(Integer[] levelIds)
    {
        return btOrganizationLevelMapper.deleteBtOrganizationLevelByIds(levelIds);
    }

    /**
     * 删除机构等级信息
     * 
     * @param levelId 机构等级ID
     * @return 结果
     */
    @Override
    public int deleteBtOrganizationLevelById(Integer levelId)
    {
        return btOrganizationLevelMapper.deleteBtOrganizationLevelById(levelId);
    }
}
